package com.ywgt.pojo;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;
import java.io.Serializable;

import com.ywgt.mybatisHandler.JsonStringArrayTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;

/**
 * <p>
 * 评论表
 * </p>
 *
 * @author yiping
 * @since 2021-03-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "dts_comment",autoResultMap = true)
@ApiModel(value="Comment对象", description="评论表")
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "如果type=0，则是商品评论；如果是type=1，则是专题评论。")
    private Integer valueId;

    @ApiModelProperty(value = "评论类型，如果type=0，则是商品评论；如果是type=1，则是专题评论；如果type=3，则是订单商品评论。")
    private Integer type;

    @ApiModelProperty(value = "评论内容")
    private String content;

    @ApiModelProperty(value = "用户表的用户ID")
    private Integer userId;

    @ApiModelProperty(value = "是否含有图片")
    private Boolean hasPicture;

    @TableField(value = "pic_urls",typeHandler = JsonStringArrayTypeHandler.class,jdbcType = JdbcType.VARCHAR)
    @ApiModelProperty(value = "图片地址列表，采用JSON数组格式")
    private String[] picUrls;

    @ApiModelProperty(value = "评分， 1-5")
    private Integer star;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private Date addTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "逻辑删除")
    private Boolean deleted;


}
